package com.example.myapplication.listener;

import android.util.Log;

import androidx.viewpager.widget.ViewPager;

/**
 * 当页面滑动时选择对应的底部tab选项
 */
public abstract class MyPageChangeListner implements ViewPager.OnPageChangeListener {

    public abstract void setTab(int postion);

    @Override
    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        Log.d("zoubo", "MyPageChangeListner-----onPageScrolled:" + positionOffset + ":" + positionOffsetPixels);
    }

    @Override
    public void onPageSelected(int position) {
        setTab(position);
    }

    @Override
    public void onPageScrollStateChanged(int state) {
        Log.d("zoubo","MyPageChangeListner---onPageScrollStateChanged:"+state);
    }
}
